package com.hdu.xxlJobLocalCacheFix.res;


import lombok.Data;

@Data
public class LocalCacheFixRes {

    private static final String SUCCESS = "SUCCESS";
    private static final String FAILURE = "FAILURE";

    private Object cacheValue;
    private String cacheValueType;
    private String executeResult;
    private String executeMsg;

    private LocalCacheFixRes() {

    }

    public static LocalCacheFixRes fail(String executeMsg) {
        LocalCacheFixRes localCacheFixRes = new LocalCacheFixRes();
        localCacheFixRes.setExecuteResult(FAILURE);
        localCacheFixRes.setExecuteMsg(executeMsg);
        return localCacheFixRes;
    }

    public static LocalCacheFixRes success(String executeMsg) {
        LocalCacheFixRes localCacheFixRes = new LocalCacheFixRes();
        localCacheFixRes.setExecuteResult(SUCCESS);
        localCacheFixRes.setExecuteMsg(executeMsg);
        return localCacheFixRes;
    }

    public boolean isSuccess() {
        return SUCCESS.equals(this.executeResult);
    }

}
